/**
 * @description: 这是Eirudy创建的类~
 * @author: Eirudy
 * @hope: 憧憬成为java大师
 **/

package org.eirudy.shareimage.api.imagesearch;


import lombok.extern.slf4j.Slf4j;
import org.eirudy.shareimage.api.imagesearch.model.ImageSearchResult;
import org.eirudy.shareimage.api.imagesearch.sub.GetImageFirstUrlApi;
import org.eirudy.shareimage.api.imagesearch.sub.GetImageListApi;
import org.eirudy.shareimage.api.imagesearch.sub.GetImagePageUrlApi;

import java.util.List;

@Slf4j
public class ImageSearchApiFacade {

    /**
     * 搜索图片
     */

    public static List<ImageSearchResult> searchImage(String url){
        String imagePageUrl = GetImagePageUrlApi.getImagePageUrl(url);
        String getFirstUrl = GetImageFirstUrlApi.getImageFirstUrl(imagePageUrl);
        return GetImageListApi.getImageList(getFirstUrl);

    }


    public static void main(String[] args) {
        List<ImageSearchResult> result = searchImage("https://www.codefather.cn/logo.png");
        System.out.println(result);
    }
}
